/*
 * Created on 2008-3-7
 *
 * TODO
 */
package jacky.lanlan.song.extension.struts.interceptor;

import jacky.lanlan.song.extension.struts.InfrastructureKeys;
import jacky.lanlan.song.extension.struts.scope.FlashScopeContainer;
import jacky.lanlan.song.web.Scope;

import java.util.Enumeration;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

/**
 * 清除拦截器，负责清除request里面无用的由插件自身产生的attribute。优先级600。
 * <p>
 * 客户端不需要使用这个拦截器。
 * 
 * @author Jacky.Song
 */
@SuppressWarnings("unused")
public class CleanInterceptor extends ActionInterceptorAdapter {

	@SuppressWarnings("unchecked")
	@Override
	public void afterCompletion(HttpServletRequest request,
			HttpServletResponse response, Object action, Exception ex) throws Exception {
		// 清除在调用执行方法期间添加的临时属性，见POJOActionController.executeBusiness()
		request.removeAttribute(InfrastructureKeys.EXECUTION);
		request.removeAttribute(InfrastructureKeys.VSAC);
		request.removeAttribute(InfrastructureKeys.REQ_DATA);
	}
	
	public int priority() {
		return 600;// 优先级在默认拦截器中最低
	}
	
}
